package com.cxy.client;

import com.cxy.prototype.Address;
import com.cxy.prototype.Student;

public class PrototypeClientA {
    public static void main(String[] args) throws CloneNotSupportedException {
        Student student = new Student();
        student.setName("张三");
        student.setAge(18);
        student.setAddress(new Address("河南","郑州"));
        Student clone = student.clone();
        clone.setName("李四");
        clone.setAge(20);
        Address address = clone.getAddress();
        address.setProvince("湖北");
        clone.setAddress(address);
        System.out.println(student);
        System.out.println(clone);
    }
}
